package com.shuqi.controller;

import android.content.Context;

import com.shuqi.activity.BookShelfActivity;
import com.shuqi.interfaces.IEventListener;
import com.shuqi.model.BookShelfModel;

/**
 * 书架Controller
 * 
 * @author Jianda.Yang
 * 
 * @Date 2014-1-18 下午3:32:52
 */
public class BookShelfController extends ControllerBase {
    private BookShelfActivity mActivity;
    private BookShelfModel shelfModel;

    public BookShelfController(Context context) {
        mActivity = (BookShelfActivity) context;
        shelfModel = new BookShelfModel(mActivity);
    }

    @Override
    public void addEventListener(IEventListener listener) {
        shelfModel.addEventListener(listener);
    }

    @Override
    public void handle(int eventType, Object... objs) {
        switch (eventType) {
            case EVENT_LOADPAGE:
                shelfModel.loadData();
                break;

            default:
                break;
        }
    }

    @Override
    public void onDestroy() {
        shelfModel.onDestroy();
    }
}
